<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>数据模型保存</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/ClientService.js"></script>
<script type="text/javascript" src="../js/common-yd.js"></script>
<script src="../../utils/CommonUtil.js" type="text/javascript"></script>
<link rel="stylesheet" href="../css/common-yd.css"></link>
<link rel="stylesheet" href="../css/EPRIS.css"></link>
<style type="text/css">
.btnCommon{
	height:30px;
	line-height:30px;
	width:80px;
	text-align:center;
	display:block;
}
</style>
</head>
<body oncontextmenu="return false" onselectstart="return false">
<div style="height:calc(100% - 50px);width:100%;">
	<div style="width:100%;height:30%;">
		<div style="float:left;width:80px;height:50px;line-height:50px;text-align:right;">接口名称：</div>
		<div style="float:left;height:32px;width:calc(100% - 100px);border:1px solid #197BFD;border-radius:5px;margin-top:9px;">
			<input id="serverNameInput" style="width:100%;height:30px;border:0px;border:0px;border-radius:5px;"/>
		</div>
	</div>
	<div style="width:100%;height:65%;">
		<div style="float:left;width:80px;height:50px;line-height:50px;text-align:right;">业务描述：</div>
		<div style="float:left;height:100%;width:calc(100% - 100px);border:1px solid #197BFD;border-radius:5px;">
			<textarea id="serverDescInput" style="width:100%;height:100%;border:0px;border:0px;border-radius:5px;"></textarea>
		</div>
	</div>
</div>
<div style="height:50px;width:100%;display:inline-flex;align-items:center;padding-left:calc(50% - 85px);border-top:1px solid #197BFF;">
	<label class="btnCommon btnSure" style="margin-right:5px;" onclick="sureInterfaceInfo()">确定</label>
	<label class="btnCommon btnClose" style="margin-left:5px;" onclick="closeInterfaceInfo()">取消</label>
</div>
<script type="text/javascript">
var modelID = null;
$(function(){
	var paramMap = getPageParameterMap();
	modelID = paramMap.modelID;
	reshowSaveServerInfo();
});

function reshowSaveServerInfo(){
	if(!modelID||modelID==null) return;
    $.ajax({
        url: "dataSourceController/getServerSaveInfo",
        type: 'POST',
        dataType: "json",
        data: JSON.stringify({modelID:modelID}),
        contentType: "application/json",
        success: function (data, status, xhr) {
            $('#serverNameInput').val(data.respData.name||"");
            $('#serverDescInput').val(data.respData.desc||"");
        }
    })
}

function sureInterfaceInfo(){
	var serverName = $.trim($('#serverNameInput').val());
	if(checkEmpty(serverName)) return showWarnDialog("接口名称不可为空");
	var serverDesc = $.trim($('#serverDescInput').val());
	closeDialog({serverName:serverName, serverDesc:serverDesc});
}

function closeInterfaceInfo(){
	closeDialog(false);
}
</script>
</body>
</html>